<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../../resource/dhtmlxsuitev508proeval/codebase/dhtmlx.js"></script>
    <link rel="stylesheet" href="../../../resource/dhtmlxsuitev508proeval/codebase/dhtmlx.css">
    <link rel="stylesheet" href="../../../resource/dhtmlxsuitev508proeval/skins/skyblue/dhtmlx.css">
    <script src="../../../js/jquery-3.4.1.js"></script>
    <style>

        .room-center {
            width: 500px;
            border: 1px solid black;
        }

        .my-center {
            display: flex;
            justify-content: center;
            flex-direction: column;
            width: 300px;
            align-items: center;
            border: 1px solid black;
            border-radius: 3px;
            margin: 5px;
        }

        .my-center > * {
            margin: 5px;
        }

        .my-center textarea {
            width: 200px;
            height: 100px;
        }

        .my-center button {
            width: 100px;
        }

    </style>
</head>
<body style="text-align: center;">
<button onclick="openNewWin()">开启一个模态框</button>
<script>
    var myWins = new dhtmlXWindows();


    function openNewWin() {
        let height = 600;
        let width = 600;

        myWins.createWindow('win1', (window.screen.availWidth - width) / 2, (window.screen.height - height - 200) / 2, height, width);
        myWins.window('win1').setText('测试内容');
        myWins.window('win1').denyMove();
        myWins.window('win1').attachURL("../popup/test1.html", null, {id: 1});
    }

    function showAlert() {
        alert("父弹窗");
    }

    function openNewWin2() {
        let height = 300;
        let width = 300;

        let win = myWins.createWindow('win2', (window.screen.availWidth - width) / 2, (window.screen.height - height - 200 * 2) / 2, height, width);
        myWins.window('win2').setText('测试内容');
        myWins.window('win2').denyMove();
        myWins.window('win2').attachURL("../layout/test1.html", null, {id: 1});
    }

    function closeOpenWin() {
        myWins.window('win1').close();
    }

</script>
</body>
</html>